package com.such.kit.database.bean;

import java.sql.DatabaseMetaData;
import com.such.kit.database.support.JdbcResultSetMapping;
import com.such.kit.datacast.CastCommons;

/**
 * @author SUCH
 * <pre>
 * 数据库索引元数据
 * 
 * [参考 {@link DatabaseMetaData#getIndexInfo(String, String, String, boolean, boolean)}]
 * </pre>
 */
public class DatabaseIndex {

	/** TYPE_STATISTIC：（tableIndexStatistic）this identifies table statistics that arereturned in conjuction with a table's index descriptions */
	public static final String TYPE_STATISTIC = "0";
	/** TYPE_CLUSTERED：（tableIndexClustered）this is a clustered index */
	public static final String TYPE_CLUSTERED = "1";
	/** TYPE_HASHED：（tableIndexHashed）this is a hashed index */
	public static final String TYPE_HASHED = "2";
	/** TYPE_OTHER：（tableIndexOther）this is some other style of index */
	public static final String TYPE_OTHER = "3";

	/** catalog：（TABLE_CAT）表所在编目 */
	@JdbcResultSetMapping("TABLE_CAT")
	private String catalog;
	/** schema：（TABLE_SCHEM）表所在模式 */
	@JdbcResultSetMapping("TABLE_SCHEM")
	private String schema;
	/** tableName：（TABLE_NAME）表名 */
	@JdbcResultSetMapping("TABLE_NAME")
	private String tableName;
	/** type：（TYPE）索引类型 [参考 TYPE_*] */
	@JdbcResultSetMapping("TYPE")
	private String type;
	/** indexName：（INDEX_NAME）索引名，type = tableIndexStatistic 时为 null */
	@JdbcResultSetMapping("INDEX_NAME")
	private String indexName;
	/** columnName：（COLUMN_NAME）列名，type = tableIndexStatistic 时为 null */
	@JdbcResultSetMapping("COLUMN_NAME")
	private String columnName;
	/** nonUnique：（NON_UNIQUE）是否为唯一索引，type = tableIndexStatistic 时为 false */
	@JdbcResultSetMapping("NON_UNIQUE")
	private String nonUnique;
	/** indexQualifier：（INDEX_QUALIFIER）index catalog (may be null); type = tableIndexStatistic 时为 null */
	@JdbcResultSetMapping("INDEX_QUALIFIER")
	private String indexQualifier;
	/** ordinalPosition：（ORDINAL_POSITION）索引列顺序号，type = tableIndexStatistic 时为 0 */
	@JdbcResultSetMapping("ORDINAL_POSITION")
	private String ordinalPosition;
	/** ascOrDesc：（ASC_OR_DESC）列排序顺序 [A 升序 | D 降序]，不支持序列排序时值为 null，type = tableIndexStatistic 时为 null */
	@JdbcResultSetMapping("ASC_OR_DESC")
	private String ascOrDesc;
	/** cardinality：（CARDINALITY）type = tableIndexStatistic 时为表中的行数，否则为唯一索引的数量 */
	@JdbcResultSetMapping("CARDINALITY")
	private String cardinality;
	/** pages：（PAGES）type = tableIndexStatistic 时为表页数，否则为索引页数 */
	@JdbcResultSetMapping("PAGES")
	private String pages;
	/** filterCondition：（FILTER_CONDITION）过滤器条件 */
	@JdbcResultSetMapping("FILTER_CONDITION")
	private String filterCondition;

	/** [参考 {@link #catalog}] */
	public String getCatalog() {
		return this.catalog;
	}

	/** [参考 {@link #catalog}] */
	public void setCatalog(String catalog) {
		this.catalog = catalog;
	}

	/** [参考 {@link #schema}] */
	public String getSchema() {
		return this.schema;
	}

	/** [参考 {@link #schema}] */
	public void setSchema(String schema) {
		this.schema = schema;
	}

	/** [参考 {@link #tableName}] */
	public String getTableName() {
		return this.tableName;
	}

	/** [参考 {@link #tableName}] */
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	/** [参考 {@link #type}] */
	public String getType() {
		return this.type;
	}

	/** [参考 {@link #type}] */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * <pre>
	 * [参考 {@link #type}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setType(double type) {
		this.type = CastCommons.numberToString(type);
	}

	/**
	 * <pre>
	 * [参考 {@link #type}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setType(long type) {
		this.type = CastCommons.numberToString(type);
	}

	/**
	 * <pre>
	 * [参考 {@link #type}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setType(int type) {
		this.type = CastCommons.numberToString(type);
	}

	/**
	 * <pre>
	 * [参考 {@link #type}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setType(short type) {
		this.type = CastCommons.numberToString(type);
	}

	/** [参考 {@link #indexName}] */
	public String getIndexName() {
		return this.indexName;
	}

	/** [参考 {@link #indexName}] */
	public void setIndexName(String indexName) {
		this.indexName = indexName;
	}

	/** [参考 {@link #columnName}] */
	public String getColumnName() {
		return this.columnName;
	}

	/** [参考 {@link #columnName}] */
	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	/** [参考 {@link #nonUnique}] */
	public String getNonUnique() {
		return this.nonUnique;
	}

	/** [参考 {@link #nonUnique}] */
	public void setNonUnique(String nonUnique) {
		this.nonUnique = nonUnique;
	}

	/**
	 * <pre>
	 * [参考 {@link #nonUnique}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setNonUnique(double nonUnique) {
		this.nonUnique = CastCommons.numberToString(nonUnique);
	}

	/**
	 * <pre>
	 * [参考 {@link #nonUnique}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setNonUnique(long nonUnique) {
		this.nonUnique = CastCommons.numberToString(nonUnique);
	}

	/**
	 * <pre>
	 * [参考 {@link #nonUnique}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setNonUnique(int nonUnique) {
		this.nonUnique = CastCommons.numberToString(nonUnique);
	}

	/**
	 * <pre>
	 * [参考 {@link #nonUnique}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setNonUnique(short nonUnique) {
		this.nonUnique = CastCommons.numberToString(nonUnique);
	}

	/** [参考 {@link #indexQualifier}] */
	public String getIndexQualifier() {
		return this.indexQualifier;
	}

	/** [参考 {@link #indexQualifier}] */
	public void setIndexQualifier(String indexQualifier) {
		this.indexQualifier = indexQualifier;
	}

	/** [参考 {@link #ordinalPosition}] */
	public String getOrdinalPosition() {
		return this.ordinalPosition;
	}

	/** [参考 {@link #ordinalPosition}] */
	public void setOrdinalPosition(String ordinalPosition) {
		this.ordinalPosition = ordinalPosition;
	}

	/**
	 * <pre>
	 * [参考 {@link #ordinalPosition}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setOrdinalPosition(double ordinalPosition) {
		this.ordinalPosition = CastCommons.numberToString(ordinalPosition);
	}

	/**
	 * <pre>
	 * [参考 {@link #ordinalPosition}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setOrdinalPosition(long ordinalPosition) {
		this.ordinalPosition = CastCommons.numberToString(ordinalPosition);
	}

	/**
	 * <pre>
	 * [参考 {@link #ordinalPosition}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setOrdinalPosition(int ordinalPosition) {
		this.ordinalPosition = CastCommons.numberToString(ordinalPosition);
	}

	/**
	 * <pre>
	 * [参考 {@link #ordinalPosition}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setOrdinalPosition(short ordinalPosition) {
		this.ordinalPosition = CastCommons.numberToString(ordinalPosition);
	}

	/** [参考 {@link #ascOrDesc}] */
	public String getAscOrDesc() {
		return this.ascOrDesc;
	}

	/** [参考 {@link #ascOrDesc}] */
	public void setAscOrDesc(String ascOrDesc) {
		this.ascOrDesc = ascOrDesc;
	}

	/** [参考 {@link #cardinality}] */
	public String getCardinality() {
		return this.cardinality;
	}

	/** [参考 {@link #cardinality}] */
	public void setCardinality(String cardinality) {
		this.cardinality = cardinality;
	}

	/**
	 * <pre>
	 * [参考 {@link #cardinality}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setCardinality(double cardinality) {
		this.cardinality = CastCommons.numberToString(cardinality);
	}

	/**
	 * <pre>
	 * [参考 {@link #cardinality}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setCardinality(long cardinality) {
		this.cardinality = CastCommons.numberToString(cardinality);
	}

	/**
	 * <pre>
	 * [参考 {@link #cardinality}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setCardinality(int cardinality) {
		this.cardinality = CastCommons.numberToString(cardinality);
	}

	/**
	 * <pre>
	 * [参考 {@link #cardinality}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setCardinality(short cardinality) {
		this.cardinality = CastCommons.numberToString(cardinality);
	}

	/** [参考 {@link #pages}] */
	public String getPages() {
		return this.pages;
	}

	/** [参考 {@link #pages}] */
	public void setPages(String pages) {
		this.pages = pages;
	}

	/**
	 * <pre>
	 * [参考 {@link #pages}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setPages(double pages) {
		this.pages = CastCommons.numberToString(pages);
	}

	/**
	 * <pre>
	 * [参考 {@link #pages}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setPages(long pages) {
		this.pages = CastCommons.numberToString(pages);
	}

	/**
	 * <pre>
	 * [参考 {@link #pages}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setPages(int pages) {
		this.pages = CastCommons.numberToString(pages);
	}

	/**
	 * <pre>
	 * [参考 {@link #pages}]
	 * 
	 * 兼容不同数据库返回值
	 * </pre>
	 */
	public void setPages(short pages) {
		this.pages = CastCommons.numberToString(pages);
	}

	/** [参考 {@link #filterCondition}] */
	public String getFilterCondition() {
		return this.filterCondition;
	}

	/** [参考 {@link #filterCondition}] */
	public void setFilterCondition(String filterCondition) {
		this.filterCondition = filterCondition;
	}

}
